import java.util.ArrayList;
import java.util.List;

public class DeleteChar {

    public static List<Character> func(String str1, String str2) {
        ArrayList<Character> ret = new ArrayList<>();
        for (int i = 0; i < str1.length(); i++) {
            char ch = str1.charAt(i);
            if (!str2.contains(ch + "")) {
                ret.add(ch);
            }
        }
        return ret;
    }


    public static void main(String[] args) {
        List<Character> ret = func("welcome to battlefield","cometo");
        for (char ch : ret) {
            System.out.print(ch);
        }
    }
}

